package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 教师扩展信息表
 * @TableName teacher_info
 */
@TableName(value ="teacher_info")
@Data
public class TeacherInfo {
    /**
     * 教师ID
     */
    @TableId(type = IdType.AUTO)
    private Long teacherId;

    /**
     * 关联用户表ID
     */
    private Long userId;

    /**
     * 教师编号
     */
    private String teacherCode;

    /**
     * 职称
     */
    private Object title;

    /**
     * 教师资格
     */
    private String qualification;

    /**
     * 研究方向
     */
    private String researchDirection;

    /**
     * 工作年限
     */
    private Integer workYears;

    /**
     * 入职日期
     */
    private Date hireDate;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TeacherInfo other = (TeacherInfo) that;
        return (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getTeacherCode() == null ? other.getTeacherCode() == null : this.getTeacherCode().equals(other.getTeacherCode()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getQualification() == null ? other.getQualification() == null : this.getQualification().equals(other.getQualification()))
            && (this.getResearchDirection() == null ? other.getResearchDirection() == null : this.getResearchDirection().equals(other.getResearchDirection()))
            && (this.getWorkYears() == null ? other.getWorkYears() == null : this.getWorkYears().equals(other.getWorkYears()))
            && (this.getHireDate() == null ? other.getHireDate() == null : this.getHireDate().equals(other.getHireDate()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getTeacherCode() == null) ? 0 : getTeacherCode().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getQualification() == null) ? 0 : getQualification().hashCode());
        result = prime * result + ((getResearchDirection() == null) ? 0 : getResearchDirection().hashCode());
        result = prime * result + ((getWorkYears() == null) ? 0 : getWorkYears().hashCode());
        result = prime * result + ((getHireDate() == null) ? 0 : getHireDate().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", teacherId=").append(teacherId);
        sb.append(", userId=").append(userId);
        sb.append(", teacherCode=").append(teacherCode);
        sb.append(", title=").append(title);
        sb.append(", qualification=").append(qualification);
        sb.append(", researchDirection=").append(researchDirection);
        sb.append(", workYears=").append(workYears);
        sb.append(", hireDate=").append(hireDate);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}